<?php
/**
 * Profile table class
 * 
 * @package    Joomla.Tutorials
 * @subpackage Components
 * @link http://docs.joomla.org/Developing_a_Model-View-Controller_Component_-_Part_4
 * @license		GNU/GPL
 */

// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

/**
 * Profile Table class
 *
 * @package    Congregation
 * @subpackage Components
 */
class TableProfile extends JTable
{
	/**
	 * Primary Key
	 *
	 * @var int
	 */
	var $id;
	var $username ;
	//var $p_id;	
	//var $c_id;
	var $lname;
	var $fname;
	var $bdate;
	var $bplace;
	var $edate;
	var $eplace;
	var $ndate;
	var $nplace;
	var $vdate;
	var $vplace;
	var $fdate;
	var $fplace;
	var $odate;
	var $oplace;
	var $ddate;
	var $dplace;
	var $altemail;
	var $status;
	var $address;
	var $cell;
	var $language;
	var $nationality;
	var $picfile;
	var $skype;
	//var $charge;
/**
	 * Constructor
	 *
	 * @param object Database connector object
	 */
	function TableProfile(& $db) {
		parent::__construct('#__congregation_profile', 'id', $db);
	}
	
	function check() {
		if (trim($this->username) == '') {
			$this->_db->setError(JText::_('Please select a username'));
	      
	      return false;
	    }
		return true;
	}
}